﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Report.WebApi.Interfaces;
using Report.WebApi.Models;
using Report.WebApi.Models.ResponseModel;

namespace Report.WebApi.Controllers
{
    [Route("api/report")]
    [ApiController]
    public class CommonController : ControllerBase
    {
        private readonly ICommonService _commonService;
        public CommonController(ICommonService commonService)
        {
            _commonService = commonService;
        }

        [Route("region")]
        [HttpGet]
        public async Task<List<RegionModel>> GetRegions([FromQuery] string ownerid)
        {
            return await _commonService.GetRegions(ownerid);
        }

        [Route("tags")]
        [HttpGet]
        public async Task<List<TagNameResponse>> GetTags([FromQuery] string ownerid)
        {
            return await _commonService.GetTags(ownerid);
        }

        [Route("category")]
        [HttpGet]
        public async Task<List<CategoryResponse>> GetCategories([FromQuery] string ownerid, string lang)
        {
            return await _commonService.GetCategory(ownerid, lang);
        }

        [Route("priority")]
        [HttpGet]
        public async Task<List<PriorityResponse>> GetPriority([FromQuery] string ownerid, string lang)
        {
            return await _commonService.GetPriority(ownerid, lang);
        }

    }
}
